Skip to content

fix(mcp): restore scalable project discovery#1181

Open
tmonestudio wants to merge 2 commits into
DeusData:mainfrom
tmonestudio:codex/fix-list-projects-coverage-scope
Open

fix(mcp): restore scalable project discovery#1181
tmonestudio wants to merge 2 commits into
DeusData:mainfrom
tmonestudio:codex/fix-list-projects-coverage-scope

Conversation

@tmonestudio

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes two MCP regressions:

  • restores deterministic pagination for list_projects, sorting database names and opening only the requested page before collecting project metadata;
  • makes expensive node/edge/Git details opt-in through include_details, while preserving the existing metadata_only=true compatibility path;
  • copies normalized check_index_coverage scope strings into the yyjson document so non-root scopes such as src cannot become NUL bytes after the stack buffer is reused.

Reproduce-first evidence

  • Production cache (632 databases): current main exceeded 60 seconds for limit=50, include_details=false; this branch returned 50/632 in 3.54 seconds.
  • Before the fix, scopes=["src"] serialized scope as three NUL bytes. The regression guard now asserts the exact requested_scope and scope strings.

Checklist

  • Every commit is signed off (git commit -s)
  • MCP suite passes locally: 166 passed, 6 platform skips
  • New behavior is covered by reproduce-first tests
  • Promoted-binary smoke passed against the 632-project cache

Paginate and sort list_projects before opening databases, keep expensive details opt-in, and preserve the metadata_only compatibility flag.

Copy normalized coverage scopes into the response document so non-root scopes do not serialize as NUL bytes. Add reproduce-first guards for both regressions.

Signed-off-by: Leonardo trindade miranda <tmonestudio@gmail.com>
@tmonestudio
tmonestudio requested a review from DeusData as a code owner July 19, 2026 23:21
@DeusData DeusData added this to the 0.9.1-rc milestone Jul 22, 2026
@DeusData DeusData added bug Something isn't working stability/performance Server crashes, OOM, hangs, high CPU/memory priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Jul 22, 2026
@DeusData

Copy link
Copy Markdown
Owner

Thanks, and sorry for the wait. Queued for review.

Mechanically in good shape: MERGEABLE with 28 checks green, +95/-12 across two files.

Project discovery scalability has come up from a few directions recently, so a targeted fix there is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. stability/performance Server crashes, OOM, hangs, high CPU/memory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants